feat(network): add support for static IPv6 assignment #4598
+180
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces end-to-end support for assigning static IPv6 addresses to containers, both via the command line and through
nerdctl compose.Key changes:
A new
--ip6flag is added tonerdctl runto allow direct assignment of a static IPv6 address.The CNI bridge configuration for IPv6 networks is now updated to declare the
"ips"capability. This is required by libcni to process static IP capability arguments.To prevent regressions in downstream CNI plugins (like dnsname and firewall), the
"dns"and"portMappings"capabilities are also explicitly declared for IPv6 networks. This avoids issues where implicit capabilities were being dropped.The compose parser now recognizes the
ipv6_addressfield within a service's network configuration and translates it to the--ip6flag during container creation.Adds comprehensive integration tests for static IPv4, IPv6, and dual-stack IP assignment, as well as unit tests for compose file parsing, to validate the new functionality and prevent regressions.
fixes #4597